/*
 * usageHelper.h
 *
 *  Created on: Sep 17, 2011
 *      Author: shaohong
 */

#ifndef USAGEHELPER_H_
#define USAGEHELPER_H_

#include <stdlib.h>

enum runningMode{assignment1Mode = 1, assignment2Mode = 2};

struct StreamerConfig {
	char radioStationURL[100]; 	// the URL to access the list of radio channels
	int localTcpPort; 		// argument following -p option
	char recipientList[300]; // the list of recipients;
	int programMode;	// whether we're in assignment 1 mode or assignment 2 mode
};

struct StreamerStats {
	char startTime[50];
	char endTime[50];
	struct timeval tStart, tEnd;

	unsigned long mp3FramesReceived;
	unsigned long pcmFramesSent;
	char rtpClientAddress[100];
};

extern void initStreamerStats(StreamerStats * streamerStats);

extern void saveStreamerStartTime(StreamerStats * streamerStats);

extern void saveStreamerEndTime(StreamerStats * streamerStats);

extern void incrementMp3FramesReceived(StreamerStats * streamerStats);

extern void incrementPcmFrameSent(StreamerStats * streamerStats);

extern void saveRtpClientAddress(StreamerStats * streamerStats, StreamerConfig config);


/*
 * display usage information to user
 */
extern void printUsage(void);

extern int parseCommandLine(int argc, char *argv[],
		StreamerConfig * streamerConfig);

extern void displayStreamerConfig(StreamerConfig streamerConfig);

// shall we run sip server?
extern bool isSipServerEnable(StreamerConfig config);

#endif /* USAGEHELPER_H_ */
